libmymath.so:my_add.o my_sub.o
	gcc -shared -o $@ $^

my_add.o:my_add.c
	gcc -fPIC -o $@ -c $^
my_sub.o:my_sub.c
	gcc -fPIC -o $@ -c $^

.PHONY:output
output:
	mkdir -p mylib/lib/
	mkdir -p mylib/include/
	cp ./*.h mylib/include/
	mv ./libmymath.so mylib/lib/


.PHONY:clean
clean:
	rm -f libmymath.so *.o

